using System;
using System.Collections.Generic;
using Microsoft.SharePoint;

namespace SharePoint.DataMapper
{
	public interface IListData
	{
		void Initialize();
		void Initialize(Guid listId);
		Guid Id { get; }
		SPList List { get; }
		ListDataContext Context { get; }
		Type ItemType { get; }
		IItemBase GetItem(int id);
		IItemBase GetItem(SPListItem spListItem);
		IEnumerable<IItemBase> GetItems();
		IEnumerable<IItemBase> GetItems(string query);
		IEnumerable<IItemBase> GetItems(SPQuery query);
		IEnumerable<IItemBase> GetItems(SPListItemCollection collection);
		void Update(IItemBase item);
		void Delete(IItemBase item);
		void Delete(int id);
	}

	public interface IListData<T>
		where T : class, IItemBase, new()
	{
		T GetItem(int id);
		T GetItem(SPListItem spListItem);
		IEnumerable<T> GetItems();
		IEnumerable<T> GetItems(string query);
		IEnumerable<T> GetItems(SPQuery query);
		IEnumerable<T> GetItems(SPListItemCollection collection);
		void Update(T item);
		void Delete(T item);
	}
}